<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
    <div id="app"></div>
    <template id="my-app">
      <div @click="movies={}">
        <button>清除</button>
      </div>
      <h2>现在上映的电影</h2>
      <div v-if="movies.length>0">
     <ul>
      <li v-for="item in movies">{{item}}</li>
     </ul>
      </div>
      <div v-else="movies.length=0"></div>
      
    </template>
    <script src="../lib/js/vue.js"></script>
  <script>
    const app=Vue.createApp({
      template:'#my-app',
      data(){
        return{
          movies:['叶问','李小龙','功夫']
        }
      },
       methods:{
        
       }
    })
    app.mount("#app")
  </script>
</body>
</html>